﻿@namespace MduiBlazor
@inherits MduiComponentBase

<div class="@Classname" style="@Style" @attributes="@AdditionalAttributes">
    @if (IconContent is not null)
    {
        @IconContent
    }
    else if (Icon is not null)
    {
        <MduiIcon Icon="@Icon" />
    }
    @if (Label is not null)
    {
        <label class="mdui-field-label">@Label</label>
    }
    <CascadingValue Name="Field" Value="@this" IsFixed>
        @ChildContent
    </CascadingValue>
    @if (_invalid)
    {
        <div class="mdui-field-error">
            @_errorText
        </div>
    }
    @if (!string.IsNullOrWhiteSpace(HelperText))
    {
        <div class="mdui-field-helper">@HelperText</div>
    }
</div>
